-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Integrate all routes from nutripatrol's API #991
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Valimp!
Please have a look at my comments.
example/lib/main.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quickly said: test your code in test files, not in main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll probably need to add the other nutripatrol classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And nutripatrol_types.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Valimp!
The code must pass the analysis tests.
@Valimp will have his midterms next week, that's why I've fixed the main warnings. Other than that, I think you can review the PR @monsieurtanuki |
@g123k As you may know currently I don't have a computer, so code reviews are sometimes acrobatic and I don't want to review too often. |
5df1fec
to
7525254
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Valimp!
Please have a look at my comments.
example/lib/main.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use this file. Nobody does.
Please create unit tests for your new classes.
lib/openfoodfacts.dart
Outdated
export 'src/model/product_type.dart'; | ||
export 'src/model/product_type_filter.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some confusion with these guys: one is moved and copied, the other is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Valimp!
Please have a look at my comments.
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
setUpAll(() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use it in the other tests. Do you really need it? If so please add a specific comment.
lib/src/utils/nutripatrol_types.dart
Outdated
@@ -0,0 +1,48 @@ | |||
import 'package:json_annotation/json_annotation.dart'; | |||
|
|||
enum NutripatrolSource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would
- extend
OffTagged
- put each
enum
in a specific file - add "Nutripatrol" and remove "Enum" in your comments
But that's not mandatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And nutripatrol_types.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you should NOT change that file, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should test the other methods of Nutripatrol.
For instance, list the tickets and find the one you've just created.
@monsieurtanuki @g123k can we finally merge this ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the comment as it was.
import 'dart:math'; | ||
|
||
import 'package:openfoodfacts/openfoodfacts.dart'; | ||
import 'package:openfoodfacts/src/nutripatrol/nutripatrol_types.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not supposed to be there, but in the list of exported dart files.
return MaybeError<CreateNutripatrolFlag>.value( | ||
CreateNutripatrolFlag.fromJson(decodedResponse)); | ||
} | ||
return MaybeError<CreateNutripatrolFlag>.responseError(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use try
/ catch
for all your MaybeError
statements, cf. prices.
@teolemon Quickly said: no.
|
What
Add nutripatrol's routes to the dart SDK
Fixes bug(s)
#885